# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>

pkgname=gnome-shell-extensions
pkgver=40.4
pkgrel=1
pkgdesc="Extensions for GNOME shell, including classic mode"
url="https://wiki.gnome.org/Projects/GnomeShell/Extensions"
arch=(any)
license=(GPL)
makedepends=(meson git sassc)
optdepends=('gnome-menus: applications menu extension')
groups=(gnome)
_commit=a5a3523df8c5ff72ade2ecca1cf0ae33d100250d  # tags/40.4^0
source=("git+https://gitlab.gnome.org/GNOME/gnome-shell-extensions.git#commit=$_commit"
        "git+https://gitlab.gnome.org/GNOME/gnome-shell-sass.git")
sha256sums=('SKIP'
            'SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname

  git submodule init
  git submodule set-url data/gnome-shell-sass "$srcdir/gnome-shell-sass"
  git submodule update
}

build() {
  arch-meson $pkgname build -D extension_set=all -D classic_mode=true
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  depends=(gnome-shell)

  meson install -C build --destdir "$pkgdir"
}
